----- MS-DOS v6.22 Help: Commands for Defining Multiple Configurations -----
<Examples>                                                         <Index>
----------------------------------------------------------------------------

               Commands for Defining Multiple Configurations

A single CONFIG.SYS file can define several different system configurations.
To define multiple configurations, you use the following special CONFIG.SYS
commands:

<Include>
<Menucolor>
<Menudefault>
<Menuitem>
<Submenu>

To define multiple configurations, follow these general steps:

1  Define a startup menu in the CONFIG.SYS file by using a [menu] header
   followed by one or more <MENUITEM>commands. The <MENUDEFAULT>,
   <MENUCOLOR> and <SUBMENU> commands can be used to define special
   characteristics of the startup menu.

2  Create a configuration block in the CONFIG.SYS file for each
   configuration you want. A configuration block begins with a block header
   -- a name surrounded by square brackets. To each block, add the
   <CONFIG.SYS commands> that you want MS-DOS to carry out when that
   configuration is selected from the startup menu.

3  (Optional) In the AUTOEXEC.BAT file, use <batch commands> such as <GOTO>
   and <IF> to have MS-DOS carry out different AUTOEXEC.BAT commands
   depending on the startup configuration.

   When a configuration is selected from the startup menu, MS-DOS defines an
   environment variable named CONFIG and sets it to the name of the selected
   configuration block. To have MS-DOS carry out different sets of commands
   for different CONFIG values, add a GOTO %CONFIG% command to your
   AUTOEXEC.BAT file.

For more information about defining multiple configurations, see the chapter
"Configuring Your System" in the MS-DOS User's Guide.

                                      ***

<Syntax>
----------------------------------------------------------------------------

                    Multiple Configurations -- Examples

Defining multiple configurations in your CONFIG.SYS file

The following CONFIG.SYS file defines two configurations:

    [Menu]
    menuitem=Steve
    menuitem=Lisa

    [Common]
    dos=high
    buffers=15
    device=c:\dos\himem.sys

    [Steve]
    files=20
    device=c:dos\emm386 2048

    [Lisa]
    files=40
    device=c:\net\network.sys

    [Common]

This CONFIG.SYS file configures the computer for either Steve or Lisa. For
both configurations, MS-DOS carries out the three commands in the first
[common] section: DOS=HIGH, BUFFERS=15, and DEVICE=C:\DOS\HIMEM.SYS. Steve
uses a desktop publishing program that requires expanded memory, so his
configuration includes a command for EMM386. He does not use the network.
Lisa uses the network but not desktop publishing. Her configuration starts
the network driver.

Defining multiple configurations in your AUTOEXEC.BAT file

When a configuration is selected from the startup menu, MS-DOS defines an
environment variable named CONFIG and sets it to the name of the selected
configuration block. In the AUTOEXEC.BAT file, you can use the <GOTO>
command to have MS-DOS carry out different sets of commands for different
CONFIG values.

The following AUTOEXEC.BAT file uses the GOTO command with the CONFIG
variable to carry out different sets of commands. This AUTOEXEC.BAT file is
designed to work with the sample CONFIG.SYS file in the preceding section.

    c:\dos\smartdrv.exe
    set temp=c:\temp
    c:\dos\msav

    ; Go to the section that matches the current
    ; value of the CONFIG variable
    goto %config%

    :Steve
    path=c:\dos;c:\deskpub;c:\typeset
    c:\mouse\mouse.com
    deskpub
    ; now skip Lisa's section & go to end
    goto end

    :Lisa
    path=c:\dos;c:\network;c:\utility
    doskey
    net logon lisa
    goto end

    :end

When MS-DOS runs this AUTOEXEC.BAT file, it starts SMARTDrive, sets the TEMP
environment variable, and starts the MS-DOS Anti-Virus program. MS-DOS then
goes to the section that matches the value of the CONFIG variable.

If the name of the selected configuration is "Steve," MS-DOS goes to the
Steve section. It then sets the search path for Steve, loads the MOUSE.COM
program from the C:\MOUSE directory, and runs the desktop publishing
program. The GOTO END command instructs MS-DOS to skip to the End section;
this prevents the commands in the Lisa section from being carried out for
Steve's configuration.

If the current configuration is "Lisa," the search path is set differently,
MS-DOS runs the Doskey program, and a Logon command instructs the network
driver (loaded from the CONFIG.SYS file) to connect the computer to the
network.

                                      ***

----------------------------------------------------------------------------
<Top of page>
Last update: December 07, 2002 14:45 by
Content © 1997 Microsoft Corporation
All else © 2000-2005
Counter